//
//  DiscoverRootVC.m
//  喜马拉雅改良版框架
//
//  Created by liuxin on 15/12/22.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "DiscoverRootVC.h"

@interface DiscoverRootVC ()

@end

@implementation DiscoverRootVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.96 green:0.96 blue:0.96 alpha:1];
    self.navigationItem.title = @"发现";
    NSMutableArray *homeVCs = [NSMutableArray array];
    NSMutableArray *homeVCTitles = [NSMutableArray array];
    for (int i = 0; i < 4; i++) {
        Class vcClass = nil;
        NSString *title = nil;
        switch (i) {
            case 0:
                vcClass = [RecommendViewController class];
                title = @"推荐";
                break;
            case 1:
                vcClass = [CategoryViewController class];
                title = @"分类";
                break;
            case 2:
                vcClass = [ListViewController class];
                title = @"榜单";
                break;
            default:
                vcClass = [AuthorViewController class];
                title = @"主播";
                break;
        }
        
        [homeVCs addObject:vcClass];
        [homeVCTitles addObject:title];
     }
    
    WMPageController *homeVC = [[WMPageController alloc] initWithViewControllerClasses:homeVCs andTheirTitles:homeVCTitles];
    homeVC.menuViewStyle = WMMenuViewStyleLine;//按钮下面是下划线效果
    homeVC.menuItemWidth = [UIScreen mainScreen].bounds.size.width/8.0;//按钮的宽度
    //标题的颜色
    homeVC.titleColorNormal = [UIColor colorWithRed:0.22 green:0.22 blue:0.21 alpha:1];
    //选中按钮的颜色
    homeVC.titleColorSelected = [UIColor colorWithRed:0.97 green:0.33 blue:0.02 alpha:1];
    // 背景颜色
    homeVC.menuBGColor = [UIColor colorWithRed:0.97 green:0.97 blue:0.97 alpha:1];
    // 导航栏高度
    homeVC.menuHeight = 35;
    // 选中时标题尺寸
    homeVC.titleSizeSelected = 16;
    homeVC.postNotification = YES;
    
    [self addChildViewController:homeVC];
    [self.view addSubview:homeVC.view];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
